<!--
 * @FilePath     : /study_code/vue2.x/createElement1.html
 * @Description  : render 渲染一个多节点
 * @Date         : 2025-05-03 10:07:44
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-05-03 10:07:44
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="" />
  </head>
  <body>
    <div id="app"></div>

    <script src="/vue/dist/vue.min.js"></script>
    <script src="./common.js"></script>
    <script>
      var app = new Vue({
        el: '#app',
        data: function () {
          return {
            blogTitle: 'This is ba blogTitle',
            content: '正文部分内容',
          }
        },
        render: function (createElement) {
          return createElement(
            'div',
            {
              // class="foo" 会被渲染到 div 标签上
              // 而 class="foo" 不会（值为 false）
              class: {
                foo: true,
                bar: false,
              },
            },
            [
              '一些文字',
              createElement('h1', '新闻标题文字'),
              // createElement(myComponent, {
              createElement(
                'p',
                {
                  props: {
                    someProp: 'footer',
                  },
                },
                [this.content]
              ),
            ]
          )
        },
      })
    </script>
  </body>
</html>
